<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/html-base.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/public.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/list.css"/>
    <script type="text/javascript" src="../../script/jquery.min.js"></script>
    <script type="text/javascript" src="../../script/newresize.js"></script>
    <script type="text/javascript" src="../../script/mui.min.js"></script>
    <style type="text/css">
    	body,html{overflow: hidden;}
    	.header{position: absolute;}
    	.container {
		    padding-top: 0;
		}
    </style>
</head>
<body>
	<!-- <header class="header fix-header">
		<a class="mui-action-back mui-icon mui-icon-left-nav"></a>
		<h1 class="mui-title">调整轮岗申请</h1>
	</header> -->
	<div class="container fankuicontainer">
		<form>
			<div class="lungangcontainer">
				<div class="lungboxs">
					<div class="lung-titbox">徒弟</div>
					<div id="uname" class="lung-sf">--</div>
				</div>
				<div class="lungboxs">
					<div class="lung-titbox">申请调整到岗位</div>
					<div id="post_name" class="lung-job">--</div>
				</div>
				<div class="lungboxs">
					<div class="lung-titbox">申请日期</div>
					<div id="apply_time" class="lung-time">----.--.--</div>
				</div>
			</div>
		</form>
		<div id="submitDiv" class="lung-btnbox" hidden="hidden">
			<span onclick="submitApply(2)" class="refuse">拒绝</span>
			<span onclick="submitApply(1)" class="agree">同意</span>
		</div>
	</div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/jquery.min.js"></script>
<script type="text/javascript" src="../../script/MD5.js"></script>
<script type="text/javascript" src="../../script/requestTool.js"></script>
<script type="text/javascript" src="../../script/timeStampTool.js"></script>
<script type="text/javascript">
	var pageParam;
	apiready = function(){
	    setupApplyData();
	}
	function setupApplyData(){
		pageParam = api.pageParam;
		var uname = pageParam.uname;
		var apply_time = pageParam.apply_time;
		var post_name = pageParam.post_name;
		$('#uname').text(uname);
		$('#post_name').text(post_name);
		$('#apply_time').text(timePointStringWithTimeStamp(apply_time));
		var apply_status = pageParam.apply_status;
		if (apply_status == 0) {
			$('#submitDiv').show();
		}
	}
	function submitApply(applyStatus){
		var params = {
			apply_status : applyStatus,
			practicestatus_id : pageParam.practicestatus_id,
			after_post_id : pageParam.post_id
		};
		api.showProgress({
		    style: 'default',
		    animationType: 'fade',
		    title: '提交中...',
		    text: '',
		    modal: true
		});
		cfnetppPOST(url_newPracticeAgreeOrRefuseApply, params, false, function(data, status){
			api.hideProgress();
			if (status == 'success') {
				if (data.code == 200) {
					api.toast({
					    msg: '审核成功'
					});
					pageParam.apply_status = applyStatus;
					api.sendEvent({
					    name: 'postApplySucceedNotifi',
					    extra: pageParam
					});
					setTimeout(function(){
						api.closeWin({
						    name: 'NewPracticeApplyChangePost_Master_win'
						});
					}, 1000);
				}else{
					api.toast({
					    msg: data.message
					});
				}
			}else{
				api.toast({
				    msg: '网络异常'
				});
			}
		});
	}
</script>
</html>